package com.zsrt.day20170427.pm;

import java.lang.annotation.Annotation;

import org.junit.Test;

/**
*@author jzh
*@创建时间 2017年4月27日下午3:18:29
*类说明：
*/
public class ServiceTest {
	
	@Test
	public void annotationTest() throws Exception{
		Class name = Class.forName("com.zsrt.day20170427.pm.Service");
		Annotation[] annotations = name.getAnnotations();
		System.out.println(annotations.length);
		for(Annotation annotation:annotations){
			Service se=(Service)annotation;
			String name2 = se.getName();
			int age = se.getAge();
			/*System.out.println(name2);
			System.out.println(age);*/
		}
	}

}
